<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <!-- 装饰器内容勿动 start -->
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="root_path" content="<%=request.getContextPath()%>" id="JQ_root_path">
    <meta name="_token" content="<%=request.getSession().getAttribute("_token")%>" id="JQ_token">
    <meta name="file_path" content="${File_Server_Path}" id="JQ_file_path">
    <meta name="menu_mark" content="${menuMark}" id="JQ_menu_mark">
    <title>阴保运行管理-异常处理单</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/core.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/style.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/js/plugin/scrollbar/css/jquery.mCustomScrollbar.css">
    <script src="<%=request.getContextPath()%>/static/js/lib/jquery-1.12.3.min.js"></script>
    <script src="<%=request.getContextPath()%>/static/js/plugin/scrollbar/js/jquery.mousewheel.min.js"></script>
    <script src="<%=request.getContextPath()%>/static/js/plugin/scrollbar/js/jquery.mCustomScrollbar.min.js"></script>
    <!-- 装饰器内容勿动 start -->
</head>
<body>
<!-- ajax loading box -->
<div class="zy-ajax-loading"><p><img src="<%=request.getContextPath()%>/static/img/loading_01.gif"></p>
    <p>数据加载中，请稍等...</p></div>
<!-- ajax error box -->
<div class="zy-error-box"><span class="zy-error-btn" title="关闭提示">×</span>
    <div class="zy-error-body"></div>
</div>
<!-- big container -->
<div class="page-container">
    <!-- menu -->
    <div class="sidebar-menu">
        <div class="sidebar-menu-inner">
            <div class="logo-nav"><img src="<%=request.getContextPath()%>/static/img/logo_defect.png"></div>
            <div id="JQ_menu_active_arr" class="hidden"><c:forEach items="${menuActiveList}" var="m">${m.id},</c:forEach></div>
            <!-- menu - list -->
            <div id="JQ_sidebar_box">
                <ul class="first-menu" id="JQ_first_menu">
                    <li class="active">
                        <a href="#" class="nav-bg-01"><i></i>设备管理</a>
                        <ul class="second-menu" style="display: block;">
                            <li class="active">
                                <a href="/pic/pbf/flawStatistics/page.html"><i></i>外腐蚀控制设备</a>
                            </li>
                            <li>
                                <a href="/pic/pbf/trend/page.html"><i></i>内腐蚀控制设备</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#" class="nav-bg-02"><i></i>管理仪表板</a>
                        <ul class="second-menu">
                            <li><a href="#"><i></i>检测结果查询</a>
                                <ul class="third-menu">
                                    <li><a
                                            href="/pic/insp/metalLoss/page.html"><i></i>金属损失</a></li>
                                    <li><a
                                            href="/pic/insp/depressed/page.html"><i></i>凹陷</a></li>
                                    <li><a
                                            href="/pic/insp/girthweld/page.html"><i></i>焊缝异常</a></li>
                                    <li><a
                                            href="/pic/insp/elliptic/page.html"><i></i>椭圆变形</a></li>
                                    <li><a
                                            href="/pic/insp/crack/page.html"><i></i>类裂纹</a></li>
                                    <li><a
                                            href="/pic/insp/other/page.html"><i></i>损伤缺陷</a></li>
                                    <li><a
                                            href="/pic/insp/patch/page.html"><i></i>补丁</a></li>
                                </ul>
                            </li>
                            <li><a href="#"><i></i>检测结果统计</a>
                                <ul class="third-menu">
                                    <li><a
                                            href="/pic/insp/statistics/metallossStat/page.html"><i></i>金属损失</a></li>
                                    <li><a
                                            href="/pic/insp/statistics/OtheDefectController/getBase.html"><i></i>其它缺陷</a>
                                    </li>
                                    <li><a href="/pic/insp/gww/gww.html"><i></i>管道特征</a>
                                    </li>
                                    <li><a
                                            href="/pic/insp/statistics/wall/page.html"><i></i>管道壁厚</a></li>
                                </ul>
                            </li>
                            <li><a href="/pic/insp/statistics/analysis/page.html"><i></i>数据对比分析</a>
                            </li>
                        </ul>
                    </li>
                    <li><a href="/pic/pbf/external/externalInspection.html"
                           class="nav-bg-03"><i></i>阴保运行管理</a></li>
                    <li><a href="/pic/pbf/suggestion/toSuggest.html"
                           class="nav-bg-04"><i></i>外检管理</a></li>
                    <li><a href="/pic/pbf/RepairTask/init.html" class="nav-bg-05"><i></i>维修整改</a>
                    </li>
                </ul>
            </div>
            <div class="copy-right">Copyright 2016<br>四川德源云管道信息技术有限公司</div>
        </div>
    </div>
    <!-- content -->
    <div class="main-content">
        <!-- top-bar -->
        <div id="JQ_top_bar" class="top-bar">
            <div class="top-bar-inner">
                <div class="top-user-info" style="width:auto">
                    <span class="top-user-photo"></span>
                    <a href="<%=request.getContextPath()%>/userSelfInfo/userSelfPage.html"><span
                            class="top-user-name">${username}</span>&nbsp;&nbsp;</a>
                    <a href="<%=request.getContextPath()%>/loginout.html"><span class="top-user-set r">退出 <i
                            class="zy-out-icon"></i></span></a>
                </div>
                <ul class="top-nav">
                    <li><a href="<%=request.getContextPath()%>/toHome.html"><i class="zy-home-icon"></i>主页</a></li>
                    <li><a href="#"><i class="zy-doc-icon"></i>文档中心</a></li>
                    <li><a href="#"><i class="zy-matter-icon"></i>管理报表</a></li>
                    <li><a href="http://www.pipemaster.cn" target="_blank"><i class="zy-service-icon"></i>专家系统</a></li>
                </ul>
            </div>
        </div>

        <!-- 你的内容 start -->
        <!-- content-body -->
        <div class="main-inner">
            <div class="content-inner">
                <div class="meta-head">
                    <h3><i class="zy-qushi-icon"></i>异常处理单</h3>
                </div>
                <div class="lsk-info">
                    <ul>
                        <li class="lsk-w40"><span class="lsk-name">管道名称:</span><span class="lsk-name-key"></span></li>
                        <li class="lsk-w60"><span class="lsk-name">所属场站阀室:</span><span class="lsk-name-key"></span></li>
                        <li class="lsk-w40"><span class="lsk-name">处置状态:</span><span class="lsk-name-key"></span></li>
                        <li class="lsk-w60"><span class="lsk-name">记录时间:</span><span class="lsk-name-key"></span></li>
                        <li class="lsk-w100"><span class="lsk-name">异常情况:</span><span class="lsk-name-key"></span></li>
                        <li class="lsk-w100"><span class="lsk-name">备注:</span><span class="lsk-name-key"></span></li>
                    </ul>
                </div>
                <p class="lsk-title">现场照片</p>
                <div class="lsk-photo">

                </div>
                <div class="lsk-map-advice">
                   <div class="left-map">
                       <p class="lsk-title">位置</p>
                       <div id="JQ_dyMap">

                       </div>
                   </div>
                    <div class="right-advice">
                        <p class="lsk-title">处理意见</p>
                        <div>
                            <textarea></textarea>
                        </div>
                    </div>
                </div>
                <div class="lsk-on-off">
                    <em></em>
                    <span>已处置</span>
                    <i class="off-on"></i>
                </div>
                <p class="lsk-title">处理记录</p>
                <div class="lsk-Processing-record">
                     <textarea></textarea>
                </div>
                <div class="zy-form-line lsk-m20">
                    <button type="button" class="zy-button zy-goback lsk-right15" id="JQ_create_goback_01"><i class="zy-goback-icon"></i>返回</button>
                    <button type="button" class="zy-button zy-submit lsk-right15" id="JQ_submit_01"><i class="zy-submit-icon"></i>确认</button>
                    <button type="button" class="zy-button zy-export exportPdf lsk-right15" id="JQ_export_btn_01"><i class="zy-export-icon"></i>导出</button>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="none" id="t_canvas_div"></div>
        </div>
        <!-- 你的内容 end -->


        <!-- JS start -->
        <!-- ui -->
        <script src="${pageContext.request.contextPath}/static/js/ui/ui-main.js"></script>
        <!-- base -->
        <script src="${pageContext.request.contextPath}/static/js/controller/base/base.controller.js"></script>
        <!-- api -->
        <script src="${pageContext.request.contextPath}/static/js/controller/api/corrctrl.api.js"></script>
        <!-- controller -->
        <script src="${pageContext.request.contextPath}/static/js/controller/corrctrl/cathodic/exceptionHandling.controller.js"></script>
        <script>
            $('#JQ_export_btn_01').click(function(){
                var $ifr_dyMap = $('#JQ_dyMap');
                var $ifr_body = $($ifr_dyMap[0].contentWindow.document.getElementById('mask_layers'));
                var html1_1 = $ifr_body.html();
                var _svg_html = html1_1.substring(html1_1.indexOf("<svg"));
                //console.log(_svg_html);
                var $t_canvas = $('<canvas id="t_canvas"></canvas>');
                $('#t_canvas_div').append($t_canvas);
                canvg("t_canvas",_svg_html);
                var _svg = $ifr_dyMap[0].contentWindow.document.getElementById('mask_gc');
                $(_svg).remove();//删掉svg
                $ifr_body.append($t_canvas);//画布填充到iframe
                $('#t_canvas_div').empty();//
                html2canvas($ifr_body, {
                    proxy: DyyBase.root_path+ '/comm/downNetFile.json',
                    onrendered: function (canvas) {
                        var url = canvas.toDataURL();
                        var $img = $('<img style="width: 100%; height: 100%">').attr('src', url);
                        $ifr_dyMap.after($img).hide();//appendTo($('#t_canvas_div'))
                        html2canvas($('.content-inner')).then(function(canvas) {
                            var url = canvas.toDataURL();
                            $img = $img.attr('src', url);

                            $ifr_dyMap.show();
                            //$img.before($ifr_dyMap);
                            $img.remove();
                            $ifr_body.find('#t_canvas').remove();//删除画布
                            $ifr_body.append(_svg);//重新显示svg
                            var pipeLineName = $('#JQ_defect_table span[title]').eq(0).attr('title');
                            var defectInfoType = $('#JQ_defect_table span[title]').eq(3).attr('title');

                            var fileName = pipeLineName + defectInfoType + "缺陷点定位单";
                            var param = [{name:'name',value:fileName},{name:'imgs',value: url},{name:'ydm',value: false}];
                            s_downFile(DyyBase.root_path+ '/comm/downImgPdf.json',param);

                        });
                    }
                });
            });
        </script>
        <!-- JS end -->
    </div>
</div>
</body>
</html>